package study;

import lombok.Data;

import java.io.Serializable;
import java.util.Comparator;
import java.util.List;

/**
 * @Author 金贵权
 * @Date 2023/6/7 11:22
 **/
@Data
public class User implements Serializable,Comparable<User> {
    private Integer id;
    private String name;
    private Integer age;
    private String description;
    private List<String> strs;

    public User(){

    }

    public User(Integer id,String name){
        this.id = id;
        this.name = name;
    }

    public User(Integer id, String name, Integer age){
        this.id = id;
        this.name = name;
        this.age = age;
    }

    public User(Integer integer) {
        id = integer;
    }

    @Override
    public int compareTo(User o) {
        return name.compareTo(o.getName());
    }
}
